
        <!DOCTYPE html>
        <html lang="en">
        <head>
            <meta charset="UTF-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>Document</title>
        </head>
        <body>
            <section>
                <!-- &quot;      ____                       ______       &quot; -->
<!-- &quot;     &#x2F; __ ____ _____ ____      &#x2F;_  __&#x2F;____   &quot; -->
<!-- &quot;    &#x2F; &#x2F;_&#x2F; &#x2F; __ `&#x2F; __ `&#x2F; _ ______&#x2F; &#x2F; &#x2F; ___&#x2F;   &quot; -->
<!-- &quot;   &#x2F; ____&#x2F; &#x2F;_&#x2F; &#x2F; &#x2F;_&#x2F; &#x2F;  __&#x2F;_____&#x2F; &#x2F; &#x2F; &#x2F;       &quot; -->
<!-- &quot;  &#x2F;_&#x2F;    __,_&#x2F;__, &#x2F;___&#x2F;     &#x2F;_&#x2F; &#x2F;_&#x2F;        &quot; -->
<!-- &quot;              &#x2F;____&#x2F;                          &quot; -->
<!-- &quot;                                              &quot; -->
<br/><br/>
  <p>
    <span>dnsmasq</span>
    <span>简单的dns服务器</span>
    <span>dnsmasq</span>
  </p>
<b>NAME</b>
    <section style="margin-left:8%;">
    <strong>dnsmasq</strong>
    - This is generated by page-tr
<br/><br/>
    </section>
<b>SYNOPSIS</b>
    <section style="margin-left:8%;">
    dnsmasq
<br/><br/>
<br/><br/>
    DNS服务器的地址，就是我的热点的地址 
<br/><br/>
<br/><br/>
<br/><br/>
<br/><br/>
    dnsmasq 做 DHCP 服务器
    &#x2F;etc&#x2F;dnsmasq.conf 
    #DNS服务器的地址，就是我的热点的地址 
    listen-address=192.168.1.1 
    #设置DHCP分配的地址范围和时间 
    dhcp-range=192.168.1.10,192.168.1.20,1h 
    #设定网关的地址，当然还是我热点的地址 
    dhcp-option=3,192.168.1.1 
    #重头戏来了，设定DNS服务器，可悲之前怎么也找不到设定的办法。。。还说是要使用DNS中继。。然后就呵呵了 
    dhcp-option=option:dns-server,114.114.114.114,8.8.4.4
<br/><br/>
    然后 
    &#x2F;etc&#x2F;init.d&#x2F;dnsmasq start 
    启动DHCP服务器
<br/><br/>
    参考：http:&#x2F;&#x2F;blog.csdn.net&#x2F;one_six_mix&#x2F;article&#x2F;details&#x2F;53245288
<br/><br/>
    实例配置文件：
<br/><br/>
    # DNS
    strict-order
    cache-size=1500
    conf-dir=&#x2F;etc&#x2F;dnsmasq.d
    # DHCP
    dhcp-option=3,172.16.1.1
    dhcp-lease-max=200
    dhcp-leasefile=&#x2F;var&#x2F;lib&#x2F;dnsmasq&#x2F;dnsmasq.leases
    interface=enp3s0
    dhcp-range=172.16.1.10,172.16.1.100,12h
<br/><br/>
    给网卡为  enp3s0的网卡口自动分配ip地址，ip 区间   172.16.1.10,172.16.1.100
<br/><br/>
    开启主机的路由转发
<br/><br/>
    </section>
<b>Example</b>
    <section style="margin-left:8%;">
<pre>
    interface=wlp1s0
    listen-address=192.168.100.1
    dhcp-range=192.168.100.50,192.168.100.100,12h
    server=8.8.8.8
</pre>
    上面配置了dnsmasq 监听的接口，该接口的IP、dhcp地址的范围、租期长短、dns等。如果想使用dhcpd也可以，这里省略dhcpd.conf的配置 
<br/><br/>
<br/><br/>
<br/><br/>
<br/><br/>
    </section>
</section>

            </section>
            <style>
                p:first-of-type{
                    margin-bottom: 15px;
                    text-align: center;
                }
                p:first-of-type span:first-child {
                    float: left;
                }
                p:first-of-type span:last-child  {
                    float: right;
                }
            </style>
        </body>
        </html>
        